(Fcopy_file): If NEWNAME is a directory, expand the
authorEli Zaretskii <eliz@is.elta.co.il>
Mon, 2 Feb 2004 20:51:18 +0000 (20:51 +0000)
committerEli Zaretskii <eliz@is.elta.co.il>
Mon, 2 Feb 2004 20:51:18 +0000 (20:51 +0000)
basename of FILE relative to it, not FILE itself.

src/fileio.c

index c7959b3672dd89b4252700fd6ebf198a08671978..737715919945696cb8a1a1e5ccb6f9bf5c35c4ac 100644 (file)
@@ -2407,7 +2407,7 @@ Also set the file modes of the target file to match the source file.  */)
   CHECK_STRING (newname);
 
   if (!NILP (Ffile_directory_p (newname)))
-    newname = Fexpand_file_name (file, newname);
+    newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname);
   else
     newname = Fexpand_file_name (newname, Qnil);